package com.lili.model.goods;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("li_category")
public class GoodsCategory implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 雪花算法生成id
     */
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    Long id;
    String createBy;

    /*创建时间*/
    @TableField(fill = FieldFill.INSERT)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime createTime;

    @TableLogic(value = "false", delval = "true")
    Byte deleteFlag;

    String updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime updateTime;

    double commissionRate;

    String image;

    int level;

    String name;

    long parentId;

    int sortOrder;

    Byte supportChannel;

    int status; //1未 2.启用 3.禁用
}
